package com.gaussian.property.app.vo.dashboard;

import cn.hutool.core.util.NumberUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @description:
 * @author: songqi(13776346982)
 * @date: 2024/10/7 15:53
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class CrewBehaviorDetail extends CrewBehaviorCount{


    /**
     * 人员ID
     */
    @ApiModelProperty("人员ID")
    private Integer crewId;
    /**
     * 人员姓名
     */
    @ApiModelProperty("人员姓名")
    private String crewName;


    /**
     * 怠工时长/单位s
     */
    @ApiModelProperty("怠工时长/单位s")
    private Double slowDownDura;



    /**
     * 聚岗时长/单位s
     */
    @ApiModelProperty("聚岗时长/单位s")
    private Double gatherPosDura;

    /**
     * 脱岗时长/单位s
     */
    @ApiModelProperty("脱岗时长/单位s")
    private Double leavePosDura;

    /**
     * 串岗时长/单位s
     */
    @ApiModelProperty("串岗时长/单位s")
    private Double gadPosDura;

    /**
     * 离场时长/单位s
     */
    @ApiModelProperty("离场时长/单位s")
    private Double leaveSiteDura;

    public Double getSlowDownDura() {
        if (slowDownDura == null) {
            return null;
        }
        return NumberUtil.div(slowDownDura, Double.valueOf(60), 2);
    }

    public Double getGatherPosDura() {
        if (gatherPosDura == null) {
            return null;
        }
        return NumberUtil.div(gatherPosDura, Double.valueOf(60), 2);
    }

    public Double getLeavePosDura() {
        if (leavePosDura == null) {
            return null;
        }
        return NumberUtil.div(leavePosDura, Double.valueOf(60), 2);
    }

    public Double getGadPosDura() {
        if (gadPosDura == null) {
            return null;
        }
        return NumberUtil.div(gadPosDura, Double.valueOf(60), 2);
    }

    public Double getLeaveSiteDura() {
        if (leaveSiteDura == null) {
            return null;
        }
        return NumberUtil.div(leaveSiteDura, Double.valueOf(60), 2);
    }
}
